package com.topnav.mc.uitls;

import com.alibaba.fastjson2.JSONObject;
import org.springframework.stereotype.Component;

/**
 * @Author: kenny
 * @Date: 2024/1/5 15:44
 */
@Component
public class VerifyCodeUtil {
    private String prefix = "VERIFY-CODE-";
    private long expire = 60L;

    public void save(String uuid, JSONObject obj){
        RedisUtil.set(prefix+uuid,obj,expire);
    }

    public JSONObject get(String key){
        return (JSONObject)RedisUtil.get(prefix+key);
    }

    public long getExpire(){
        return expire;
    }
}
